import {
	GET_LIST_DATA,
	GET_LIST_ISFETCHING
} from './mutation-types.js'



export default {

	loadListData({commit, state}, num) {

		commit(GET_LIST_ISFETCHING);
		
		let data = [...state.list.data];
		let start = state.list.data.length - 1;
		let len = parseInt(num);

		for (var i = 0; i < len; i++) {
			data.push({
				id: ++start
			});
		}
		setTimeout(() => commit(GET_LIST_DATA, {data}), 500);
	},
}